import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useLoginStore = defineStore('login', () => {
  const loginData=ref({token:''})
  function saveLoginData(payload:any){
      loginData.value=payload
  }

  function removeLoginData(){
    loginData.value={token:''}
  }
  return {  loginData,saveLoginData,removeLoginData}
},{ 
  persist:true  //开启持久化
}

)
